# Path to the common makefiles
SHARE = ../../../make

# Name and type of the (sub)project
META = strategies

# Version number
MAJOR = 1
MINOR = 0
REVISION = 0

# Add extra files to the distribution
DISTFILES = $(shell ls *.str *.meta)

# Include the common makefile
include $(SHARE)/include.make

# Local stuff
SDF = $(SC_TOP)/share/sdf
STRC = strc
STRINCLUDES = -I $(SDF)/p-tools -I $(SDF)/xml-front -I ../include -I include

STRSOURCES = $(shell ls *.str)
TRANSFORMS = $(basename $(STRSOURCES))

clean: myclean
myclean:
	rm -f $(STRSOURCES:.str=.c) $(STRSOURCES:.str=.dep) $(STRSOURCES:.str=.lo) $(STRSOURCES:.str=.o) $(TRANSFORMS)

all: $(TRANSFORMS)

$(TRANSFORMS): %: %.str %.meta
	strc -i $< $(STRINCLUDES) -Cl stratego-sglr -la stratego-lib --xtc-repo $(SC_TOP)/share/strategoxt/XTC

#clean: myclean
#myclean:
#	rm -f *~ *.dep *.o $(TRANSFORMS)

install: all

include ../../sc.make
